package com.terry.study.custom;

import com.terry.study.proxy.jdk.Person;
import java.lang.reflect.Method;

public class GPMeipo implements GPInvocationHandler {



    private Person target;
    public Object getInstance(Person target) {

        this.target = target;
        Class clazz = target.getClass();
        System.out.println(clazz);
        return GPProxy.newProxyInstance(new GPClassLoader(),clazz.getInterfaces(),this);
    }

    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
//        System.out.println("你的性别是："+this.target.getSex()+"得给你介绍个异性");
        System.out.println("开始进行海选。。。");
        System.out.println("----------------------");
        this.target.findLove();
        System.out.println("----------------------");
        System.out.println("如果合适的话，就准备办事");
        return null;
    }
}
